import { createRouter, createWebHashHistory } from 'vue-router';
import Index from "@/views/index/index.vue";
import Login from "@/views/Login.vue";
import Plan from "@/views/plan/plan.vue";
import Profile from "@/views/profile/profile.vue";
import PlanOrder from "@/views/plan/planOrder.vue"
import HotelOrderMain from "@/views/hotel/hotelOrderMain.vue";
import HotelOrder from "@/views/hotel/hotelOrder.vue";
import Admin from "@/views/admin/admin.vue";
import UserManagement from "@/views/admin/UserManagement.vue";
import FlightManagement from "@/views/admin/FlightManagement.vue";
import OrderManagement from "@/views/admin/OrderManagement.vue";
import PlanOrderMain from "@/views/plan/planOrderMain.vue"
import HotelManagement from "@/views/admin/HotelManagement.vue";
import RoomManagement from "@/views/admin/RoomManagement.vue";
import AirlinerManagement from "@/views/admin/AirlinerManagement.vue";
import HotelOrderManagement from "@/views/admin/HotelOrderManagement.vue";
import Center from "@/views/profile/center.vue";
import ProfileMain from "@/views/profile/profileMain.vue";
import AdminMain from "@/views/admin/adminMain.vue";
import coupon from "@/views/profile/coupon.vue";
import couponManagement from "@/views/admin/couponsManagement.vue"
import points from "@/views/profile/points.vue"
import message from "@/views/profile/message.vue"

// import Orders from "@/views/profile/Orders.vue";
// import Messages from "@/views/profile/Messages.vue";
// import Coupons from "@/views/profile/Coupons.vue";
// import Points from "@/views/profile/Points.vue";
// import Favorites from "@/views/profile/Favorites.vue";
// import Invoices from "@/views/profile/Invoices.vue";
// import Info from "@/views/profile/Info.vue";
// import Center from "@/views/profile/Center.vue";
// import Profile_main from '@/views/profile/profileMain.vue';

const routes = [
  {
    path: '/',
    name: 'home',
    component: Index
  },
  {
    path: "/login",
    name:"login",
    component: Login
  },
  {
    path: "/plan",
    name:"plan",
    component: Plan
  },
  {
    path: "/profile",
    name: "profile",
    component: Profile,
    redirect: "/profile/orders",
    children:[
        {
      path: 'center',
      name:"Center",
      component: Center
    },
      {
        path: 'orders',
        name: "ProfileMain",
        component: ProfileMain
      },
      {
        path: 'coupons',
        name: "coupons",
        component: coupon
      },
      {
        path: 'points',
        name: "points",
        component: points
      },
      {
        path: 'messages',
        name: "messages",
        component: message
      }
    ]

  },
  {
    path: '/planOrder',
    name: 'PlanOrder',
    component: PlanOrder,
    props: route => ({ cfcity: route.query.cfcity, ddcity: route.query.ddcity })
  },
  {
    path: '/hotelOrderMain',
    name: 'HotelOrderMain',
    component: HotelOrderMain
  },
  {
    path: '/hotelOrder',
    name: 'HotelOrder',
    component: HotelOrder
  },
  {
    path: '/admin',
    name: 'Admin',
    component: Admin,
    children: [
      {
        path: 'main',
        name: 'AdminMain',
        component: AdminMain
      },
      {
        path: 'user',
        name: 'UserManagement',
        component: UserManagement,
        meta: {
          breadcrumb: '用户管理'
        }
      },
      {
        path: 'flight',
        name: 'FlightManagement',
        component: FlightManagement,
        meta: {
          breadcrumb: '航班管理'
        }
      },
      {
        path: 'flight-order',
        name: 'OrderManagement',
        component: OrderManagement,
        meta: {
          breadcrumb: '航班订单管理'
        }
      },
      {
        path: "hotel-info",
        name: "HotelManagement",
        component: HotelManagement,
        meta: {
          breadcrumb: '酒店信息管理'
        }
      },
      {
        path: "hotel-room",
        name: "RoomManagement",
        component: RoomManagement,
        meta: {
          breadcrumb: '客房信息管理'
        }
      },
      {
        path: "airliner",
        name: "AirlinerManagement",
        component: AirlinerManagement,
        meta: {
          breadcrumb: '客机管理'
        }
      },
      {
        path: "hotel-order",
        name: "HotelOrderManagement",
        component: HotelOrderManagement,
        meta: {
          breadcrumb: '酒店订单管理'
        },
      },
      {
        path: "coupons",
        name: "couponsManagement",
        component: couponManagement,
        meta: {
          breadcrumb: '优惠券管理'
        },
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router;
